package 装饰者.饮料里随便加调料;

// 调料：牛奶
public class Milk extends Decorator{
    public Milk(Drink drink) {
        super(drink);
        setDesc("牛奶");
        setPrice(2.0f);
    }

    @Override
    float cost() {
        //super是 Coffee.cost(),这里的drink是Coffee对象
        return super.cost() + getPrice();
    }
}
